package scenetracer;



public class SceneTracerOptions {

	
	private String port;
	private String address;
	private boolean isMaster = false;
	private boolean isClient = false;
	
	public String getPort() {
		return port;
	}

	public void setPort(String port) {
		this.port = port;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public boolean isMaster() {
		return isMaster;
	}

	public void setMaster(boolean isMaster) {
		this.isMaster = isMaster;
	}

	public boolean isClient() {
		return isClient;
	}

	public void setClient(boolean isClient) {
		this.isClient = isClient;
	}
	
	private boolean showProgress = false;

	private boolean showResult = false;
	private boolean timer = false;
	
	private Integer penumbra = 0;
	private String fileInput = null;
	private String fileOutput = null;
	
	private Integer numThreads = 1;

	private Integer benchmark=0;
	
	
	public boolean isNumThreadsEnabled() {
		return numThreads != null;
	}
	
	public boolean isBenchmarkEnabled() {
		return benchmark != 0;
	}
	

	public boolean isShowProgress() {
		return showProgress;
	}
	
	public boolean isShowResult() {
		return showResult;
	}
	
	public Integer getNumThreads() {
		return numThreads;
	}

	
	
	public String getFileInput() {
		return fileInput;
	}
	
	public String getFileOutput() {		
		return fileOutput;
	}
	
	
	
	public void setFileInput(String fileInput) {
		this.fileInput = fileInput;
	}
	
	public void setFileOutput(String fileOutput) {
		this.fileOutput = fileOutput;
	}
	
	public void setFileOutputDefault(String fileOutput) {
		String auxFileInput = new String(fileInput);
		auxFileInput.replace('\\', '/');
		String [] splittedInputFilename = this.fileInput.split("\\.[A-Za-z]*$");
		String fullNameWithoutExtension = splittedInputFilename[0];
		this.fileOutput = fullNameWithoutExtension + ".png";
	}
	
	
	
	public void setNumThreads(Integer numThreads) {
		this.numThreads = numThreads;
	}
	
	
	public void enableShowProgress() {
		this.showProgress = true;
	}
	
	public void enableShowResult() {
		this.showResult = true;
	}

	public void setBenchmark(Integer benchmark) {
		this.benchmark = benchmark;
	}

	public Integer getBenchmark() {
		return benchmark;
	}

	public void setTimer(boolean timer) {
		this.timer = timer;
	}

	public boolean isTimerEnabled() {
		return timer;
	}

	public void setPenumbraLimit(Integer penumbra) {
		this.penumbra = penumbra;
	}

	public Integer getPenumbraLimit() {
		return penumbra;
	}

	public boolean isPenumbraEnabled() {
		// TODO Auto-generated method stub
		return penumbra>0;
	}



}
